class CreateTagRelationships < ActiveRecord::Migration[6.0]
  def change
    create_table :tag_relationships do |t|
      t.references :tag, null: false
      t.references :related_tag, null: false
      t.integer :relevance

      t.timestamps
    end

    add_index :tag_relationships, [:tag_id, :related_tag_id], unique: true
  end
end
